package com.lsnu.ehr;

import java.util.HashMap;
import java.util.Map;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//@ResponseBody 以json格式输出到浏览器
@ResponseBody
//@Controller 标示本类为控制器类
@Controller
//@SpringBootApplication 表示本类是springboot应用程序，需要使用springboot框架
@SpringBootApplication
public class LeEhrApplication {

	public static void main(String[] args) {
		//使用springboot的起动器
		SpringApplication.run(LeEhrApplication.class, args);
	}
	
	//类似于servletmapping
	//标示当/wellcome请求由本方法处理
	@RequestMapping("wellcome")
	public Object wellcome() {
		Map<String, String> map = new HashMap<>();
		map.put("name", "Chiva");
		map.put("job", "teacher");
		map.put("wellcome", "pilipa");
		
		return map;
	}
}
